#!/usr/bin/env python

def get_sorted_tuple(x, y):
    if x <= y:
        return (x, y)
    else:
        return (y, x)

def get_sorted_tuple_n(x, y, n):
    if x <= y:
        return (x, y, n)
    else:
        return (y, x, n)


def safe_int(n):
    if n:
        return n[0]
    else:
        return 0

